<%-- 
    Document   : nuevo
    Created on : 18/08/2009, 05:06:26 PM
    Author     : ChristianATE
--%>

<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<f:view>

    <span class="titulo"><h:outputText style= "margin-left:20px" value="NUEVO" /></span>
    <br><br>

    <t:div>
        <h:form>
            <t:panelGrid columns="2" >
                <t:outputLabel value="Tipo de Tramite:" />
                <h:selectOneMenu value="#{TransaccionController.tramiteSeleccionado}" >
                    <f:selectItem itemValue="0" itemLabel="Seleccionar Tramite" />
                    <f:selectItems value="#{tramiteController.tramiteItems}" />
                    <a4j:support ajaxSingle="true" event="onchange" reRender="panel1" action="#{TransaccionController.listar}"/>
                </h:selectOneMenu>
                <t:commandButton action="#{tramiteController.grabar}" value="Grabar" />
                <t:commandButton action="buscar" value="Cancelar" />
            </t:panelGrid>
            <br><br>
            <a4j:outputPanel id="panel1" ajaxRendered="true">
                <rich:dataTable value="#{TransaccionController.documentos}"
                                var="docr" rows="15" reRender="ds" id="simpletable"
                                width="100%" columnsWidth="10%,50%,20%, 20%">
                    <rich:column>
                        <f:facet name="header"> <h:outputLabel value="CODIGO" /></f:facet>
                        <h:outputText value="#{docr.fkTdoCodigo.tdoCodigo}"></h:outputText>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header"> <h:outputLabel value="DESCRIPCION" /></f:facet>
                        <h:outputText value="#{docr.fkTdoCodigo.tdoDesc}"></h:outputText>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header"> <h:outputLabel value="TIPO" /></f:facet>
                        <h:outputText value="#{docr.fkTdoCodigo.tdoTipo}"></h:outputText>
                    </rich:column>
                    <f:facet name="footer">
                        <rich:datascroller id="ds" renderIfSinglePage="false"></rich:datascroller>
                    </f:facet>
                </rich:dataTable>
            </a4j:outputPanel>
        </h:form>
    </t:div>
</f:view>
